{% load i18n freeadmin %}
<form data-dojo-type="dijit.form.Form" encType="multipart/form-data">
<script type="dojo/event" data-dojo-event="onSubmit" data-dojo-args="e">
var form = this;
require([
  "dojo/_base/event",
  "dijit/registry"
], function(
  dEvent,
  registry
) {
  dEvent.stop(e);
  var dialog = registry.getEnclosingWidget(form.domNode.parentNode);
  console.log(dialog.parentForm);
  dialog.submitForm();
  dialog.hide();
});
</script>
<table class="form">
    <tr>
        <td>
        {% block confirm %}
        {{ message|safe }}
        {% endblock %}
        </td>
    </tr>

    {% block buttons %}
    <tr>
        <td>
            <button class="submitform" data-dojo-type="dijit.form.Button" data-dojo-props="type:'submit'">
                {% trans "Yes" %}
            </button>
            {% if not inline %}
            <button data-dojo-type="dijit.form.Button" class="cancelform">
                {% trans "No" %}
                <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
                    cancelDialog(this);
                </script>
            </button>
            {% endif %}
        </td>
    </tr>
    {% endblock %}
</table>

</form>
